package com.jingyanzi.sys.text;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.jingyanzi.sys.domain.FeedbackDO;
import com.jingyanzi.sys.domain.MemberGradeDO;
import com.jingyanzi.sys.domain.RightsDO;
import com.jingyanzi.sys.domain.result.PageAll;
import com.jingyanzi.sys.domain.service.IFeedbackService;
import com.jingyanzi.sys.domain.service.IMemberConfigService;

@RestController
@RequestMapping("/iMemberConfig")
public class ImemberConfigDemo {
	
	@Autowired
	private IMemberConfigService iMemberConfigService;
	@RequestMapping("/add")
	public Object add() {
		
		RightsDO rightsDO=new RightsDO();
		
		rightsDO.setLevel(1);
		rightsDO.setBusinessId(2);
		return iMemberConfigService.addRights(rightsDO);
	}
	@RequestMapping("/showById")
	public Object showById() {
		
		return iMemberConfigService.getRights(1);
	}
	@RequestMapping("/delete")
	public Object delete() {
		return iMemberConfigService.removeRights(1,"chenglin");
	}
	@RequestMapping("/update")
	public Object update() {
		MemberGradeDO gradeDO=new MemberGradeDO();
		gradeDO.setId(1);
		gradeDO.setModifi("BBBBBBBBBBBBBBB");
		
		return iMemberConfigService.modifiGrade(gradeDO);
	}
	@RequestMapping("/showAll")
	public Object showAll() {
		PageAll page=new PageAll();
		page.setPagesize(10);
		page.setPageindex(1);
		return iMemberConfigService.queryRights(null);
	}
	
	
	@RequestMapping("/add1")
	public Object add1() {
		
		
		MemberGradeDO gradeDO=new MemberGradeDO();
		
		gradeDO.setStatus(1);
		gradeDO.setName("chenglin");
		
		return iMemberConfigService.addGrade(gradeDO);
	}
	@RequestMapping("/showById1")
	public Object showById1() {
		
		return iMemberConfigService.getGrade(1);
	}
	@RequestMapping("/showAll1")
	public Object showAll1() {
		PageAll page=new PageAll();
		page.setPagesize(2);
		page.setPageindex(1);
		return iMemberConfigService.queryGrade(null);
	}
}
